package com.zjy.software.day12;

public class PC {
    private String name;
    private int age;
    private String type;
    private Long price;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PC pc = (PC) o;

        if (age != pc.age) return false;
        if (name != null ? !name.equals(pc.name) : pc.name != null) return false;
        if (type != null ? !type.equals(pc.type) : pc.type != null) return false;
        if (price != null ? !price.equals(pc.price) : pc.price != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + age;
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        return result;
    }
}
